Optimal. Leaf size=382 \[ \frac {a^2 e x}{b^3}+\frac {e x}{2 b}+\frac {a^2 f x^2}{2 b^3}+\frac {f x^2}{4 b}+\frac {a (e+f x) \cos (c+d x)}{b^2 d}+\frac {i a^3 (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {i a^3 (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}+\frac {a^3 f \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}-\frac {a^3 f \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}-\frac {a f \sin (c+d x)}{b^2 d^2}-\frac {(e+f x) \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f \sin ^2(c+d x)}{4 b d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.44, antiderivative size = 382, normalized size of antiderivative = 1.00, number of steps
used = 16, number of rules used = 9, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.346, Rules used = {4611, 3391,
3377, 2717, 3404, 2296, 2221, 2317, 2438} \begin {gather*} \frac {a^3 f \text {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 d^2 \sqrt {a^2-b^2}}-\frac {a^3 f \text {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b^3 d^2 \sqrt {a^2-b^2}}+\frac {a^2 e x}{b^3}+\frac {a^2 f x^2}{2 b^3}+\frac {i a^3 (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 d \sqrt {a^2-b^2}}-\frac {i a^3 (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b^3 d \sqrt {a^2-b^2}}-\frac {a f \sin (c+d x)}{b^2 d^2}+\frac {a (e+f x) \cos (c+d x)}{b^2 d}+\frac {f \sin ^2(c+d x)}{4 b d^2}-\frac {(e+f x) \sin (c+d x) \cos (c+d x)}{2 b d}+\frac {e x}{2 b}+\frac {f x^2}{4 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2296
Rule 2317
Rule 2438
Rule 2717
Rule 3377
Rule 3391
Rule 3404
Rule 4611
Rubi steps
\begin {align*} \int \frac {(e+f x) \sin ^3(c+d x)}{a+b \sin (c+d x)} \, dx &=\frac {\int (e+f x) \sin ^2(c+d x) \, dx}{b}-\frac {a \int \frac {(e+f x) \sin ^2(c+d x)}{a+b \sin (c+d x)} \, dx}{b}\\ &=-\frac {(e+f x) \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f \sin ^2(c+d x)}{4 b d^2}-\frac {a \int (e+f x) \sin (c+d x) \, dx}{b^2}+\frac {a^2 \int \frac {(e+f x) \sin (c+d x)}{a+b \sin (c+d x)} \, dx}{b^2}+\frac {\int (e+f x) \, dx}{2 b}\\ &=\frac {e x}{2 b}+\frac {f x^2}{4 b}+\frac {a (e+f x) \cos (c+d x)}{b^2 d}-\frac {(e+f x) \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f \sin ^2(c+d x)}{4 b d^2}+\frac {a^2 \int (e+f x) \, dx}{b^3}-\frac {a^3 \int \frac {e+f x}{a+b \sin (c+d x)} \, dx}{b^3}-\frac {(a f) \int \cos (c+d x) \, dx}{b^2 d}\\ &=\frac {a^2 e x}{b^3}+\frac {e x}{2 b}+\frac {a^2 f x^2}{2 b^3}+\frac {f x^2}{4 b}+\frac {a (e+f x) \cos (c+d x)}{b^2 d}-\frac {a f \sin (c+d x)}{b^2 d^2}-\frac {(e+f x) \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f \sin ^2(c+d x)}{4 b d^2}-\frac {\left (2 a^3\right ) \int \frac {e^{i (c+d x)} (e+f x)}{i b+2 a e^{i (c+d x)}-i b e^{2 i (c+d x)}} \, dx}{b^3}\\ &=\frac {a^2 e x}{b^3}+\frac {e x}{2 b}+\frac {a^2 f x^2}{2 b^3}+\frac {f x^2}{4 b}+\frac {a (e+f x) \cos (c+d x)}{b^2 d}-\frac {a f \sin (c+d x)}{b^2 d^2}-\frac {(e+f x) \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f \sin ^2(c+d x)}{4 b d^2}+\frac {\left (2 i a^3\right ) \int \frac {e^{i (c+d x)} (e+f x)}{2 a-2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{b^2 \sqrt {a^2-b^2}}-\frac {\left (2 i a^3\right ) \int \frac {e^{i (c+d x)} (e+f x)}{2 a+2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{b^2 \sqrt {a^2-b^2}}\\ &=\frac {a^2 e x}{b^3}+\frac {e x}{2 b}+\frac {a^2 f x^2}{2 b^3}+\frac {f x^2}{4 b}+\frac {a (e+f x) \cos (c+d x)}{b^2 d}+\frac {i a^3 (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {i a^3 (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {a f \sin (c+d x)}{b^2 d^2}-\frac {(e+f x) \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f \sin ^2(c+d x)}{4 b d^2}-\frac {\left (i a^3 f\right ) \int \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{b^3 \sqrt {a^2-b^2} d}+\frac {\left (i a^3 f\right ) \int \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{b^3 \sqrt {a^2-b^2} d}\\ &=\frac {a^2 e x}{b^3}+\frac {e x}{2 b}+\frac {a^2 f x^2}{2 b^3}+\frac {f x^2}{4 b}+\frac {a (e+f x) \cos (c+d x)}{b^2 d}+\frac {i a^3 (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {i a^3 (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {a f \sin (c+d x)}{b^2 d^2}-\frac {(e+f x) \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f \sin ^2(c+d x)}{4 b d^2}-\frac {\left (a^3 f\right ) \text {Subst}\left (\int \frac {\log \left (1-\frac {2 i b x}{2 a-2 \sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{b^3 \sqrt {a^2-b^2} d^2}+\frac {\left (a^3 f\right ) \text {Subst}\left (\int \frac {\log \left (1-\frac {2 i b x}{2 a+2 \sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{b^3 \sqrt {a^2-b^2} d^2}\\ &=\frac {a^2 e x}{b^3}+\frac {e x}{2 b}+\frac {a^2 f x^2}{2 b^3}+\frac {f x^2}{4 b}+\frac {a (e+f x) \cos (c+d x)}{b^2 d}+\frac {i a^3 (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {i a^3 (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}+\frac {a^3 f \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}-\frac {a^3 f \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}-\frac {a f \sin (c+d x)}{b^2 d^2}-\frac {(e+f x) \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f \sin ^2(c+d x)}{4 b d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 4.92, size = 752, normalized size = 1.97 \begin {gather*} -\frac {2 \left (2 a^2+b^2\right ) (c+d x) (c f-d (2 e+f x))-8 a b d (e+f x) \cos (c+d x)+b^2 f \cos (2 (c+d x))+\frac {8 a^3 d (e+f x) \left (\frac {2 (d e-c f) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}-\frac {i f \left (\log \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {b+\sqrt {-a^2+b^2}+a \tan \left (\frac {1}{2} (c+d x)\right )}{-i a+b+\sqrt {-a^2+b^2}}\right )+\text {Li}_2\left (\frac {a \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a+i \left (b+\sqrt {-a^2+b^2}\right )}\right )\right )}{\sqrt {-a^2+b^2}}+\frac {i f \left (\log \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {b+\sqrt {-a^2+b^2}+a \tan \left (\frac {1}{2} (c+d x)\right )}{i a+b+\sqrt {-a^2+b^2}}\right )+\text {Li}_2\left (\frac {a \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a-i \left (b+\sqrt {-a^2+b^2}\right )}\right )\right )}{\sqrt {-a^2+b^2}}+\frac {i f \left (\log \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {-b+\sqrt {-a^2+b^2}-a \tan \left (\frac {1}{2} (c+d x)\right )}{i a-b+\sqrt {-a^2+b^2}}\right )+\text {Li}_2\left (\frac {a \left (i+\tan \left (\frac {1}{2} (c+d x)\right )\right )}{i a-b+\sqrt {-a^2+b^2}}\right )\right )}{\sqrt {-a^2+b^2}}-\frac {i f \left (\log \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {b-\sqrt {-a^2+b^2}+a \tan \left (\frac {1}{2} (c+d x)\right )}{i a+b-\sqrt {-a^2+b^2}}\right )+\text {Li}_2\left (\frac {a+i a \tan \left (\frac {1}{2} (c+d x)\right )}{a+i \left (-b+\sqrt {-a^2+b^2}\right )}\right )\right )}{\sqrt {-a^2+b^2}}\right )}{d e-c f+i f \log \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right )-i f \log \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right )}+8 a b f \sin (c+d x)+2 b^2 d (e+f x) \sin (2 (c+d x))}{8 b^3 d^2} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 685 vs. \(2 (342 ) = 684\).
time = 0.69, size = 686, normalized size = 1.80
method | result | size |
risch | \(\frac {a^{2} f \,x^{2}}{2 b^{3}}+\frac {f \,x^{2}}{4 b}+\frac {a^{2} e x}{b^{3}}+\frac {e x}{2 b}+\frac {a \left (d x f +d e +i f \right ) {\mathrm e}^{i \left (d x +c \right )}}{2 b^{2} d^{2}}+\frac {a \left (d x f +d e -i f \right ) {\mathrm e}^{-i \left (d x +c \right )}}{2 b^{2} d^{2}}-\frac {2 i a^{3} e \arctan \left (\frac {2 i b \,{\mathrm e}^{i \left (d x +c \right )}-2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{b^{3} d \sqrt {-a^{2}+b^{2}}}-\frac {a^{3} f \ln \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}-\sqrt {-a^{2}+b^{2}}}{i a -\sqrt {-a^{2}+b^{2}}}\right ) x}{b^{3} d \sqrt {-a^{2}+b^{2}}}-\frac {a^{3} f \ln \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}-\sqrt {-a^{2}+b^{2}}}{i a -\sqrt {-a^{2}+b^{2}}}\right ) c}{b^{3} d^{2} \sqrt {-a^{2}+b^{2}}}+\frac {a^{3} f \ln \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{i a +\sqrt {-a^{2}+b^{2}}}\right ) x}{b^{3} d \sqrt {-a^{2}+b^{2}}}+\frac {a^{3} f \ln \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{i a +\sqrt {-a^{2}+b^{2}}}\right ) c}{b^{3} d^{2} \sqrt {-a^{2}+b^{2}}}-\frac {i a^{3} f \dilog \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{i a +\sqrt {-a^{2}+b^{2}}}\right )}{b^{3} d^{2} \sqrt {-a^{2}+b^{2}}}+\frac {i a^{3} f \dilog \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}-\sqrt {-a^{2}+b^{2}}}{i a -\sqrt {-a^{2}+b^{2}}}\right )}{b^{3} d^{2} \sqrt {-a^{2}+b^{2}}}+\frac {2 i a^{3} f c \arctan \left (\frac {2 i b \,{\mathrm e}^{i \left (d x +c \right )}-2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{b^{3} d^{2} \sqrt {-a^{2}+b^{2}}}-\frac {f \cos \left (2 d x +2 c \right )}{8 b \,d^{2}}-\frac {\left (f x +e \right ) \sin \left (2 d x +2 c \right )}{4 d b}\) | \(686\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 1254 vs. \(2 (340) = 680\).
time = 0.56, size = 1254, normalized size = 3.28 \begin {gather*} -\frac {2 i \, a^{3} b f \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} {\rm Li}_2\left (\frac {i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) + {\left (b \cos \left (d x + c\right ) + i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b} + 1\right ) - 2 i \, a^{3} b f \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} {\rm Li}_2\left (\frac {i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) - {\left (b \cos \left (d x + c\right ) + i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b} + 1\right ) - 2 i \, a^{3} b f \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} {\rm Li}_2\left (\frac {-i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) + {\left (b \cos \left (d x + c\right ) - i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b} + 1\right ) + 2 i \, a^{3} b f \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} {\rm Li}_2\left (\frac {-i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) - {\left (b \cos \left (d x + c\right ) - i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b} + 1\right ) - {\left (2 \, a^{4} - a^{2} b^{2} - b^{4}\right )} d^{2} f x^{2} - 2 \, {\left (2 \, a^{4} - a^{2} b^{2} - b^{4}\right )} d^{2} x e + {\left (a^{2} b^{2} - b^{4}\right )} f \cos \left (d x + c\right )^{2} - 2 \, {\left (a^{3} b c f - a^{3} b d e\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (2 \, b \cos \left (d x + c\right ) + 2 i \, b \sin \left (d x + c\right ) + 2 \, b \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} + 2 i \, a\right ) - 2 \, {\left (a^{3} b c f - a^{3} b d e\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (2 \, b \cos \left (d x + c\right ) - 2 i \, b \sin \left (d x + c\right ) + 2 \, b \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - 2 i \, a\right ) + 2 \, {\left (a^{3} b c f - a^{3} b d e\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-2 \, b \cos \left (d x + c\right ) + 2 i \, b \sin \left (d x + c\right ) + 2 \, b \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} + 2 i \, a\right ) + 2 \, {\left (a^{3} b c f - a^{3} b d e\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-2 \, b \cos \left (d x + c\right ) - 2 i \, b \sin \left (d x + c\right ) + 2 \, b \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - 2 i \, a\right ) - 2 \, {\left (a^{3} b d f x + a^{3} b c f\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-\frac {i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) + {\left (b \cos \left (d x + c\right ) + i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b}\right ) + 2 \, {\left (a^{3} b d f x + a^{3} b c f\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-\frac {i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) - {\left (b \cos \left (d x + c\right ) + i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b}\right ) - 2 \, {\left (a^{3} b d f x + a^{3} b c f\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-\frac {-i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) + {\left (b \cos \left (d x + c\right ) - i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b}\right ) + 2 \, {\left (a^{3} b d f x + a^{3} b c f\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-\frac {-i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) - {\left (b \cos \left (d x + c\right ) - i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b}\right ) - 4 \, {\left ({\left (a^{3} b - a b^{3}\right )} d f x + {\left (a^{3} b - a b^{3}\right )} d e\right )} \cos \left (d x + c\right ) + 2 \, {\left (2 \, {\left (a^{3} b - a b^{3}\right )} f + {\left ({\left (a^{2} b^{2} - b^{4}\right )} d f x + {\left (a^{2} b^{2} - b^{4}\right )} d e\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left (a^{2} b^{3} - b^{5}\right )} d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F(-1)]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \text {Hanged} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________